package day03.homework.expand;

import java.util.Scanner;

public class YearDemo {
    public static void main(String[] args) {
        while (true) {
            System.out.println("请输入年份！(输入0退出)");
            int year = new Scanner(System.in).nextInt();
            if (year<0){
                System.out.println("格式错误，请重新输入！");
                continue;
            }else if(year==0){
                break;
            }else if(year%4==0&&year%100!=0  || year%400==0){
                System.out.println(year+"年是闰年");
            }else {
                System.out.println(year+"年是平年");
            }


        }
    }
}
